package com.c5p1ng.core.generator.bank;

import com.c5p1ng.core.util.ArrayUtils;

/**
 * 银行枚举类
 *
 * @author c5p1ng
 */
public enum BankNameEnum {
    ICBC("102", "中国工商银行", "工行", new Integer[]{622200, 955880}, new Integer[]{427020, 427030, 530990, 622230, 622235, 622210, 622215}),
    ABC("103", "中国农业银行", "农行"),
    BOC("104", "中国银行", "中行"),
    CCB("105", "中国建设银行", "建行"),
    BCOM("301", "交通银行", "交行"),
    CITIC("302", "中信银行"),
    CEB("303", "中国光大银行"),
    HXB("304", "华夏银行"),
    CMBC("305", "中国民生银行"),
    CGB("306", "广东发展银行"),
    PAB("307", "平安银行"),
    CMB("308", "招商银行", "招行"),
    CIB("309", "兴业银行"),
    SPDB("310", "上海浦东发展银行"),
    CR("999999", "华润银行", new Integer[]{622363}),
    BHB("318", "渤海银行"),
    HSB("319", "徽商银行"),
    JSB_1("03133010", "江苏银行"),
    JSB("03133120", "江苏银行"),
    SHB("04012900", "上海银行"),
    POST("403", "中国邮政储蓄银行"),
    BOB("", "北京银行"),
    BON("", "宁波银行");

    private final String code;
    private final String name;
    private String abbrName;
    private Integer[] creditCardPrefixes;
    private Integer[] debtCardPrefixes;
    private Integer[] allCardPrefixes;

    private BankNameEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private BankNameEnum(String code, String name, String abbrName) {
        this.code = code;
        this.name = name;
        this.abbrName = abbrName;
    }

    private BankNameEnum(String code, String name, String abbrName, Integer[] debtCardPrefixes, Integer[] creditCardPrefixes) {
        this.code = code;
        this.name = name;
        this.abbrName = abbrName;
        this.creditCardPrefixes = creditCardPrefixes;
        this.debtCardPrefixes = debtCardPrefixes;
        this.allCardPrefixes = (Integer[]) ArrayUtils.addAll(this.creditCardPrefixes, this.debtCardPrefixes);
    }

    private BankNameEnum(String code, String name, Integer[] debtCardPrefixes) {
        this.code = code;
        this.name = name;
        this.debtCardPrefixes = debtCardPrefixes;
        this.allCardPrefixes = debtCardPrefixes;
    }

    private BankNameEnum(String code, String name, Integer[] debtCardPrefixes, Integer[] creditCardPrefixes) {
        this.code = code;
        this.name = name;
        this.creditCardPrefixes = creditCardPrefixes;
        this.debtCardPrefixes = debtCardPrefixes;
        this.allCardPrefixes = (Integer[])ArrayUtils.addAll(this.creditCardPrefixes, this.debtCardPrefixes);
    }

    public String getName() {
        return this.name;
    }

    public String getAbbrName() {
        return this.abbrName;
    }

    public Integer[] getCreditCardPrefixes() {
        return this.creditCardPrefixes;
    }

    public Integer[] getDebtCardPrefixes() {
        return this.debtCardPrefixes;
    }

    public Integer[] getAllCardPrefixes() {
        return this.allCardPrefixes;
    }

    public String getCode() {
        return this.code;
    }
}
